package com.example.yixueban.Tool;

/**
 * User: Wang YiHan
 * Date: 2021/7/22 19:53
 * Email: 783096044@qq.com
 * File_Name: null.java
 **/
public class Const {
    public static final int page_size = 6;
    public static final int Admin_page_size = 5;
    public static final int site_page_size = 20;
    public static final String PICTURE_PATH = "D:\\competition\\src\\main\\resources\\picture";
    public int codeStatus;

    public static String truncateHeadString(String origin, int count) {  //去掉String前几个字符
        if (origin == null || origin.length() < count) {
            return null;
        }
        char[] arr = origin.toCharArray();
        char[] ret = new char[arr.length - count];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = arr[i + count];
        }
        return String.copyValueOf(ret);
    }

    public static String truncateLastString(String origin, int count){ //去掉String后几个字符
        if (origin == null || origin.length() < count) {
            return null;
        }
        char[] arr = origin.toCharArray();
        char[] ret = new char[arr.length - count];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = arr[i];
        }
        return String.copyValueOf(ret);
    }
}
